﻿<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<jsp:useBean id="dateValue" class="java.util.Date"/>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>
<!DOCTYPE html>
<html lang="en">
<head>
    <base href="<%=basePath%>">
    <!-- jsp文件头和头部 -->
    <%@ include file="../admin/top.jsp" %>
    <style>
        table tr td img {
            height: 25px;
            border-radius: 8%;
        }
    </style>
</head>
<body>
<div class="container-fluid" id="main-container">
    <div id="page-content" class="clearfix">
        <div class="row-fluid">
            <div class="row-fluid">
                <!-- 检索  -->
                <form action="firstRechargeRenewRemind/list" method="post" name="firstRechargeRenewRemindForm" id="firstRechargeRenewRemindForm">
                    <input type="hidden" name="menuId" value="${page.menuId}">
                    <table style="width: 10%;float: right">
                        <tr>
                            <td style="vertical-align:top;">
                                <c:if test="${fn:contains(butSet, 'add')}">
                                    <a class="btn btn-small btn-success" onclick="add();">添加提醒</a>
                                </c:if>
                            </td>
                        </tr>
                    </table>
                    <!-- 检索  -->
                    <table id="table_report" class="table table-striped table-bordered table-hover">
                        <thead>
                        <tr>
                            <%--<th>id</th>--%>
                            <th>间隔周期(秒)</th>
                            <th>续费临近时间（秒）</th>
                            <th>提醒标题</th>
                            <th>提醒内容</th>
                            <th>类型</th>
                            <th>创建时间</th>
                            <th>修改时间</th>
                            <th>操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        <!-- 开始循环 -->
                        <c:choose>
                            <c:when test="${not empty firstRechargeRenewReminds}">
                                <c:forEach items="${firstRechargeRenewReminds}" var="firstRechargeRenewRemind">
                                    <tr style="text-align: center">
                                        <td>${firstRechargeRenewRemind.period}</td>
                                        <td>${firstRechargeRenewRemind.recentlyTime}</td>
                                        <td>${firstRechargeRenewRemind.title}</td>
                                        <td>${firstRechargeRenewRemind.content}</td>
                                        <td>
                                            <c:choose>
                                                <c:when test="${firstRechargeRenewRemind.type == 0}">
                                                    首充提醒
                                                </c:when>
                                                <c:when test="${firstRechargeRenewRemind.type == 1}">
                                                    续费提醒
                                                </c:when>
                                                <c:otherwise>
                                                    未知状态
                                                </c:otherwise>
                                            </c:choose>
                                        </td>

                                        <td>
                                            <fmt:formatDate value="${firstRechargeRenewRemind.createTime}" pattern="yyyy-MM-dd HH:mm:ss"/>
                                        </td>
                                        <td>
                                            <fmt:formatDate value="${firstRechargeRenewRemind.updateTime}" pattern="yyyy-MM-dd HH:mm:ss"/>
                                        </td>
                                        <td>
                                            <div class='hidden-phone visible-desktop btn-group'>
                                                <c:if test="${fn:contains(butSet, 'edit') }">
                                                    <a class='btn btn-mini btn-danger' title="编辑" onclick="edit('${firstRechargeRenewRemind.id }');">
                                                        编辑
                                                    </a>
                                                </c:if>
                                            </div>
                                        </td>
                                    </tr>
                                </c:forEach>
                            </c:when>
                            <c:otherwise>
                                <tr class="main_info">
                                    <td colspan="8" class="center">没有相关数据</td>
                                </tr>
                            </c:otherwise>
                        </c:choose>
                        </tbody>
                    </table>
                    <div class="page-header position-relative">
                        <table style="width:100%;">
                            <tr>
                                <td style="vertical-align:top;">
                                    <div class="pagination"
                                         style="float: right;padding-top: 0px;margin-top: 0px;">${page.pageStr}</div>
                                </td>
                            </tr>
                        </table>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
<!-- 返回顶部  -->
<a href="#" id="btn-scroll-up" class="btn btn-small btn-inverse">
    <i class="icon-double-angle-up icon-only"></i>
</a>
<!-- 引入 -->
<script type="text/javascript">window.jQuery || document.write("<script src='static/js/jquery-1.9.1.min.js'>\x3C/script>");</script>
<script src="static/js/bootstrap.min.js"></script>
<script src="static/js/ace-elements.min.js"></script>
<script src="static/js/ace.min.js"></script>

<script type="text/javascript" src="static/js/chosen.jquery.min.js"></script><!-- 下拉框 -->
<script type="text/javascript" src="static/js/bootstrap-datepicker.min.js"></script><!-- 日期框 -->
<script type="text/javascript" src="static/js/bootbox.min.js"></script><!-- 确认窗口 -->
<!-- 引入 -->
<script type="text/javascript" src="static/js/jquery.tips.js"></script><!--提示框-->
<script type="text/javascript">
    $(top.hangge());

    //检索
    /*function search() {
        top.jzts();
        $("#firstRechargeRenewRemindForm").submit();
    }*/

    //新增
    function add() {
        top.jzts();
        var diag = new top.Dialog();
        diag.Drag = true;
        diag.Title = "添加充值提醒";
        diag.URL = '<%=basePath%>firstRechargeRenewRemind/toAdd';
        diag.Width = 500;
        diag.Height = 650;
        diag.CancelEvent = function () { //关闭事件
            if (diag.innerFrame.contentWindow.document.getElementById('zhongxin').style.display == 'none') {
                if ('${page.currentPage}' == '0') {
                    top.jzts();
                    $("#firstRechargeRenewRemindForm").submit();
                } else {
                    nextPage(${page.currentPage});
                }
            }
            diag.close();
        };
        diag.show();
    }

    //修改
    function edit(id) {
        top.jzts();
        var diag = new top.Dialog();
        diag.Drag = true;
        diag.Title = "编辑充值提醒";
        diag.URL = '<%=basePath%>firstRechargeRenewRemind/toEdit?id=' + id;
        diag.Width = 500;
        diag.Height = 650;
        diag.CancelEvent = function () { //关闭事件
            if (diag.innerFrame.contentWindow.document.getElementById('zhongxin').style.display == 'none') {
                nextPage(${page.currentPage});
            }
            diag.close();
        };
        diag.show();
    }

</script>

<script type="text/javascript">
    $(function () {
        //日期框
      /*  $('.date-picker').datepicker({autoclose: true});*/
        //下拉框
        $(".chzn-select").chosen();
        $(".chzn-select-deselect").chosen({allow_single_deselect: true});
        //复选框
       /* $('table th input:checkbox').on('click', function () {
            var that = this;
            $(this).closest('table').find('tr > td:first-child input:checkbox')
                .each(function () {
                    this.checked = that.checked;
                    $(this).closest('tr').toggleClass('selected');
                });
        });*/
    });
</script>
</body>
</html>
